package cn.edu.zjicm.wordsnet_d.activity;

import com.umeng.analytics.MobclickAgent;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ListView;
import cn.edu.zjicm.wordsnet_d.R;
import cn.edu.zjicm.wordsnet_d.activity.base.WordBaseActivity;
import cn.edu.zjicm.wordsnet_d.adapter.VoicePackAdapter;

public class DownloadVoicePackActivity extends WordBaseActivity {

	public static int INIT_MODE = 0;
	public static int ADD_MODE = 1;
	public static int INIT_MODE2 = 2; 	// 从引导页面进来，需要返回键

	private int startMode;

	private ListView mListView;

	public static DownloadVoicePackActivity mInstance;

	public static void mStartActivity(Context mContext, int startMode) {
		Intent in = new Intent(mContext, DownloadVoicePackActivity.class);
		in.putExtra("startMode", startMode);
		mContext.startActivity(in);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_download_voice_pack);
		mInstance = DownloadVoicePackActivity.this;
		startMode = getIntent().getIntExtra("startMode", INIT_MODE);

		setTitleBarStyle(WordBaseActivity.TITLE_BAR_STYLE_BACK_BUTTON);
		setTitleText("下载语音包");

		findView();
		initView();
	}

	private void findView() {
		mListView = (ListView) findViewById(R.id.voice_pack_lv);
	}

	private void initView() {
		VoicePackAdapter adapter = new VoicePackAdapter(this);
		mListView.setAdapter(adapter);
	}

	@Override
	protected void onResume() {
		super.onResume();
		MobclickAgent.onResume(this);
	}

	@Override
	protected void onPause() {
		super.onPause();
		MobclickAgent.onPause(this);
	}

}
